package com.huilian.iotbox.admin.quartz.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.huilian.iotbox.admin.quartz.dao.JobAndTriggerDao;
import com.huilian.iotbox.admin.quartz.service.IJobAndTriggerService;
import com.huilian.iotbox.data.common.ServerResponse;
import com.huilian.iotbox.data.quartz.entity.JobAndTrigger;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: zhangyingjie
 * @description:
 * @date: 2018/11/17 17:43
 */
@Service
public class JobAndTriggerSeviceImpl implements IJobAndTriggerService {

    @Resource
    private JobAndTriggerDao jobAndTriggerDao;

    @Override
    public ServerResponse getJobAndTriggerDetails(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<JobAndTrigger> list = jobAndTriggerDao.getJobAndTriggerDetails();
        PageInfo pagResult = new PageInfo(list);
        pagResult.setList(list);
        return ServerResponse.createBySuccess(pagResult);
    }
}
